/*package com.gexin.controller.system;
import java.util.LinkedList;
import java.util.List;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.gexin.common.model.AjaxCmd;
import com.gexin.common.utils.StringUtil;
import com.gexin.core.interceptor.SystemAuthInterceptor;
import com.gexin.model.Wxuser;
import com.gexin.model.system.AdminLog;
import com.gexin.model.system.AdminLog.Log_Live;
import com.gexin.plugin.thread.TaskUtils;
import com.gexin.weixin.thread.WeiXinUserSyn;
import com.gexin.weixin.uitls.WxConfig;
import com.jfinal.aop.Before;
import com.jfinal.ext.route.ControllerBind;
import com.jfinal.log.Log;
import com.jfinal.weixin.sdk.api.ApiConfig;
import com.jfinal.weixin.sdk.api.ApiConfigKit;
import com.jfinal.weixin.sdk.api.ApiResult;
import com.jfinal.weixin.sdk.api.UserApi;
import com.jfinal.weixin.sdk.jfinal.ApiController;
*//**
 * 后台管理员模板
 * @author 肖得明
 *  新增的时候复制这个
 *//*
@Before(SystemAuthInterceptor.class)//拦截用户登陆
@ControllerBind(controllerKey = "/system/weixin/user", viewPath = "WEB-INF/system/")
public class WeixinUserController extends ApiController {
	@SuppressWarnings("unused")
	private static final Log log =  Log.getLog(WeixinUserController.class);
	public ApiConfig getApiConfig() {
		return WxConfig.Api_Config;
	}
	*//**
	 * 获取分页 页码
	 * @return
	 *//*
	public int getpage(){
		return getParaToInt("pageNumber",1);
	}
	*//**
	 * 分页数据
	 * @param data
	 *//*
	public void paginate(Object data ){
		setAttr("data", data);
	}
	//首页
	public void index(){
		Wxuser  user  =  getModel(Wxuser.class,"user");
		paginate(Wxuser.dao.paginate(user, getpage(), 10));
		setAttr("user", user);
		render("weixin_user.html");
	}
	
	public void sync_user(){
		ApiConfigKit.setThreadLocalApiConfig( WxConfig.Api_Config);
		AdminLog.dao.addLog(Log_Live.wanring, "开始同步粉丝信息！");
		ApiResult apiResult = UserApi.getFollows();
		JSONObject jsonObject =JSONObject.parseObject(apiResult.getJson());
		String next_openid =  jsonObject.getString("next_openid"); 
		while(!next_openid.equals("")){
		JSONArray openid= jsonObject.getJSONObject("data").getJSONArray("openid");
		List<WeiXinUserSyn>  task_list = new LinkedList<WeiXinUserSyn>();
		for(int i=0;i<openid.size();i++){
			String uname =openid.get(i).toString();  
			task_list.add(new WeiXinUserSyn(uname));
		}
		TaskUtils.handleTasks(task_list, 10);
		if(!StringUtil.show(next_openid).equals("")){
			 apiResult = UserApi.getFollowers(jsonObject.getString("next_openid"));
			 jsonObject =JSONObject.parseObject(apiResult.getJson());
			 next_openid =  jsonObject.getString("next_openid"); 
		 }
		}
		renderJson(new AjaxCmd(true));

}

}


*/